/**
 *判断cpu字节序
 *
 */
#include <stdio.h>
int main()
{
  if (1 == checkCPU())
  {
    printf("Little-endian\n");
  }
  else
  {
    printf("Big-endian\n");
  }

  return 0;
}

int checkCPU( )
{
  {
    union w
    {  
      int a;
      char b;
    } c;
    c.a = 1;
    return(c.b ==1);
  }
}
